<!--  -->
<template>
  <div class="qbox">
    <el-row>
      <el-col :span="8" :offset="0">
        <el-form label-width="80px" :inline="false" size="normal">
          <el-form-item :label="index+1+'.问题：'">
            <el-input v-model="item.q" size="normal" clearable style="marginBottom:15px"></el-input>
          </el-form-item>
          <el-form-item label="答案：">
            <el-input v-model="item.a" size="normal" clearable></el-input>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="5" :offset="1">
        <el-button type="primary" size="default" @click="$emit('addQue')">新增</el-button>
        <el-button type="primary" size="default" @click="$emit('delQue')">编辑</el-button>
        <el-button type="danger" size="default" v-if="index!=0" @click="$emit('delQue')">删除</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: ["index", "item", "addQue", "delQue"],
  data() {
    return {
      // question:'',
      // answer:''
    };
  }
};
</script>
<style>
.qbox {
  margin-bottom: 20px;
}
</style>